package models

import (
	//_ "github.com/go-sql-driver/mysql" // import your used driver
	"github.com/go-xorm/xorm"
	_ "github.com/lib/pq"
)

var db *xorm.Engine

func OpenDB(dbtype string, dbconnstr string) {
	engine, err := xorm.NewEngine(dbtype, dbconnstr)
	if err != nil {
		panic("无法连接数据库:" + err.Error())
	}
	db = engine
	db.ShowSQL(true)
}
